<template>
  <div class="block-item">
    <div v-if="type" class="block-header" :class="'header-'+type">
      <div class="header-title">{{ title }}</div>
      <div class="sub-title">{{ subTitle }}</div>
    </div>
    <div :style="type?{height:'calc(100% - 43px)'}:{height:'100%'}" class="block-content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "BlockItem",
  props:{
    type:{
      type:String,
      default:'',
    },
    title:{
      type:String,
      default:'',
    },
    subTitle:{
      type:String,
      default:'',
    }
  }
}
</script>

<style lang="scss" scoped>
.block-item{
  width:100%;
  .block-header{
    width: 100%;
    display: flex;
    height: 43px;
    padding-left:50px;
    padding-right: 30px;
    align-items: center;
    justify-content: space-between;
    .header-title{
      color: #fff;
      font-size: 14px;
    }
    .sub-title{
      font-size: 12px;
      color: #838486;
    }
  }
  .block-header.header-1{
    background: url("~@/assets/images/block-header1.png") no-repeat center;
    background-size: 100% 100%;
  }
  .block-header.header-2{
    background: url("~@/assets/images/blue.png") no-repeat center;
    background-size:100% 100%;
  }
  .block-header.header-3{
    background: url("~@/assets/images/orange.png") no-repeat center;
    background-size:100% 100%;
  }
  .block-content{
    width: 100%;
    height: calc(100% - 43px);
  }
}
</style>
